package com.song.module.app.controller;


import com.song.common.result.R;
import com.song.module.admin.request.ApUserChefRecordRequest;
import com.song.module.admin.response.ApChefAppointmentResponse;
import com.song.module.admin.service.IApUserChefOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 厨师预约记录控制层
 *
 * @author song
 * @date 2024-03-08
 */
@Slf4j
@AllArgsConstructor
@RestController
@Api(value = "厨师预约记录接口管理", tags = "厨师预约记录接口管理")
@RequestMapping("/app/apUserChefRecord")
public class AppUserChefOrderController {

    private final IApUserChefOrderService iApUserChefOrderService;


    /**
     * 我的预约记录
     */
    @ApiOperation(value = "我的预约记录")
    @PostMapping("/list")
    public R<List<ApChefAppointmentResponse>> list(@RequestBody ApUserChefRecordRequest apUserChefRecordRequest) {
        return R.success(iApUserChefOrderService.appointmentRecord(apUserChefRecordRequest));
    }


    /**
     * 预约厨师
     */
    @ApiOperation(value = "预约厨师")
    @PostMapping("/appointment")
    public R<Void> add(@Validated @RequestBody ApUserChefRecordRequest apUserChefRecordRequest) {
        iApUserChefOrderService.appointment(apUserChefRecordRequest);
        return R.success();
    }

}
